from abc import ABCMeta, abstractmethod

class WaterHeater:
    def __init__(self):
        self.__observers == []
        self.__temperature = 25
    def getTemperature(self):
        return self.__temperature
    def setTemperature(self, Temperature):
        self.__Temperature = Temperature
        print "now is %s C" % str(self.__Temperature)
        self.notifies()
    def addObserver(self, observer):
        self.__observers.append(observers)
    def notifies(self):
        for o in self.__observers:
            o.update(self)
class Observer(metaclass=ABCMeta):
    @abstractmethod
    def update(self, WaterHeater):
        pass
class WashingMode(Observer):
    def update(self, WaterHeater):
        if WaterHeater.getTemperature() >= 50 and WaterHeater.getTemperature() < 70:
            print "yes"
class DrinkingMode(Observer):
    def update(self, WaterHeater):
        if WaterHeater.getTemperature() >= 100:
            print "you can drink it"
    

def testWaterHeater():
    heater = WaterHeater()
    washingObser = WashingMode()
    drinkingObser = DrinkingMode()
    heater.addObserver(washingObser)
    heater.addObserver(DrinkingMode)
    hea